-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(zeroize): added zeorizing to Felt
#100
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is feature-gated behind the `zeroing` flag
tdelabro
requested changes
Jan 23, 2025
tdelabro
approved these changes
Mar 24, 2025
@pefontana @dan-starkware @maciejka @0xLucqs can we get a second review? |
0xLucqs
requested changes
Mar 24, 2025
Applied your suggestions @0xLucqs, thanks for catching that! |
0xLucqs
approved these changes
Mar 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is feature-gated behind the
zeroing
flagPull Request type
What is the current behavior?
Felt
provides no option to zeroize its memory, which can be an issue when dealing with sensitive cryptographic information such as private keys.Resolves: #99
What is the new behavior?
Felt
through thezeroize
crate. Whilezeroize
is not used directly, Felt implements manually theZeroize
trait in the hopes of making this behavior more 'standard'. This has been gated behind thezeroing
feature.Note
Contrarily to
zeroize
, this is done using safe rust by leveragingcore::mem::take
to replace the in-memory representation of a felt with its default value ofFelt::ZERO
.Does this introduce a breaking change?
No. While the
zeroing
feature has been added todefault
, zeroing has not been implemented on drop, both because this would interfere with theCopy
trait ofFelt
but also because it seems like it should be up to the end user to determine when they are dealing with sensitive information.